Skip to content

Fix issue #79: Make DirectoryStringChoiceType configurable #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ic0ns
Copy link
Contributor

@ic0ns ic0ns commented Jun 26, 2025

Summary

  • Fixed the hardcoded UTF8 encoding in AttributeTypeAndValue by removing incorrect XML annotation
  • The DirectoryStringChoiceType is now properly configurable via X509CertificateConfig
  • Added comprehensive tests to verify the fix works correctly

Changes

  1. Removed incorrect @XmlElement(name = "attributeField") annotation from the defaultDirectoryStringType field in X509CertificateConfig
  2. Added unit tests for X509CertificateConfig to verify:
    • The default value is UTF8_STRING
    • Different encoding types can be set programmatically
    • XML serialization/deserialization preserves the configured value
  3. Added unit tests for AttributeTypeAndValue to verify:
    • Different DirectoryStringChoiceType values are properly applied
    • The configured encoding type is used throughout certificate creation

Test plan

  • Unit tests pass for X509CertificateConfig configurability
  • Unit tests pass for AttributeTypeAndValue with different encoding types
  • Code formatted with spotless
  • Maven build succeeds with all tests passing

Fixes #79

…teTypeAndValue

- Removed incorrect @xmlelement annotation from defaultDirectoryStringType field in X509CertificateConfig
- The field is already configurable via getter/setter methods
- Added comprehensive tests to demonstrate configurability
- Tests verify both programmatic configuration and XML serialization/deserialization

This allows users to configure the default encoding type for AttributeTypeAndValue objects
instead of being hardcoded to UTF8_STRING.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant